package fuzzyLogicCalculator;

import utils.Dentre;

public class FuzzyCalc <T extends FuzzyLogic> 
											implements IFuzzyCalc{
	private T operation;
	
	public FuzzyCalc(FuzzyLogic logicType) {
		operation=(T) logicType;
	
	}

	@Override
	public double calcular(float value) {
	
		return operation.calcular(value);
	}

	@Override
	public double complemento(float value) {
		
		return 1-operation.calcular(value);
	}
	
	public static void main (String args[]){
		FuzzyCalc<Cuarenton> calc= new FuzzyCalc<Cuarenton>(new Cuarenton());
		while (true){
			System.out.println("ingrese valor de cuarenton");
			int edad=Dentre.readInt();
			if (edad==-1)
				System.exit(0);
			System.out.println("valor: "+calc.calcular(edad));
		}
		
	}
	

}
